@mixin __tsr($def: null) {
  transform: #{$def} /**默认变换*/ scale(var(--scale, 1)) scale(var(--zoom, 1)) /**放大缩小*/ scaleX(var(--mirror, 1)) /**镜像反转*/
    rotate(var(--rotate, 0deg)) /**旋转*/ translate(var(--moveX, 0), var(--moveY, 0)) /**平移*/ !important;
}

/** 信息提示 **/
.monkey-toast {
  line-height: normal;
  left: 10px !important;
  bottom: 16% !important;
  color: #fff !important;
  font-size: 13px !important;
  padding: 6px 10px !important;
  border-radius: 5px !important;
  position: absolute !important;
  z-index: 2147483647 !important;
  font-weight: normal !important;
  transition: opacity 0.3s ease-in !important;
  background: rgba(0, 0, 0, 0.75) !important;

  span {
    display: inline !important;
  }
}

/** 视频网页全屏相关样式 START **/
::part(webFullscreen),
[part*="webFullscreen"],
body[part*="webFullscreen"] [part*="webFullscreen"] {
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  zoom: normal !important;
  border: none !important;
  width: 100vw !important;
  height: 100vh !important;
  position: fixed !important;
  transform: none !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  transition: none !important;
  z-index: 2147483646 !important;
  background-color: #000 !important;
  flex-direction: column !important;
  overflow: hidden !important;
  display: flex !important;
}

/** 隐藏后面的兄弟元素 */
[part*="webFullscreen"] ~ *:not(.monkey-web-fullscreen) {
  display: none !important;
}

[part*="webFullscreen"] {
  /** 为 control 做特殊处理 */
  .vjs-control-bar,
  .ytp-chrome-bottom,
  .ytp-chapter-hover-container {
    left: 0 !important;
    width: 100vw !important;
  }
}

/** 增强选择器优先级 **/
[part*="webFullscreen"] video,
body[part*="webFullscreen"] [part*="webFullscreen"] video {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  border: none !important;
  height: clamp(calc(100vh - 100%), 100vh, 100%) !important;
  object-fit: contain !important;
  @include __tsr();
}
/** 视频网页全屏相关样式 END **/

/** 视频变换样式 */
.__tsr {
  object-fit: contain !important;
  transform-origin: center !important;
  transition: transform 0.35s !important;
  @include __tsr("var(--deftsr, matrix(1, 0, 0, 1, 0, 0))");
}

/** 隐藏鼠标光标 **/
.__hc {
  cursor: none !important;
}

/** 拾取剧集、更多设置弹窗样式 **/
.monkey-web-fullscreen {
  z-index: 2147483647 !important;

  * {
    box-sizing: border-box !important;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
  }

  .hide {
    display: none !important;
  }

  .swal2-popup {
    font-size: 14px !important;
  }

  button:where(.swal2-styled) {
    &:focus {
      box-shadow: 0 0 0 1px rgba(100, 150, 200, 0.5) !important;
    }
  }

  .swal2-confirm {
    background-color: #7066e0 !important;
  }

  .swal2-deny {
    background-color: #dc3741 !important;
  }

  .swal2-cancel {
    background-color: #757575 !important;
  }

  button:where(.swal2-close) {
    color: #666 !important;
    font-size: 1.7em !important;
    font-weight: bolder !important;
  }

  /** 拾取下集元素弹窗布局 START **/
  h4 {
    color: red !important;
    margin: 0 auto !important;
    font-size: 18px !important;
    font-weight: normal !important;
  }

  p {
    color: #999 !important;
    margin-top: 0 !important;
    font-size: 12px !important;
  }

  #__picker {
    width: 100% !important;
    height: auto !important;
    max-width: 25em !important;
    font-size: 14px !important;
    margin-bottom: 0 !important;
    min-height: 10em !important;
    resize: vertical !important;

    &:focus {
      box-shadow: 0 0 0 1px rgba(100, 150, 200, 0.5) !important;
    }
  }
  /** 拾取下集元素弹窗布局 END **/

  /* Tabs 标题栏 */
  .swal2-tabs-header {
    display: flex;
    position: relative;
    margin-bottom: 15px;
    font-size: 15px !important;
    border-bottom: 1px solid #e2e8f0;
  }

  .swal2-tab {
    flex: 1;
    cursor: pointer;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    padding: 12px 10px;
    position: relative;
    transition: all 0.2s ease;
  }

  .swal2-tab.active {
    color: #3b82f6;
  }

  .swal2-tab.active::after {
    left: 0;
    content: "";
    width: 100%;
    height: 2px;
    bottom: -1px;
    position: absolute;
    visibility: visible;
    background-color: #3b82f6;
    border-radius: 2px 2px 0 0;
  }

  .swal2-tab:hover:not(.active) {
    color: #3b82f6;
  }

  /* Tabs 内容区 */
  .swal2-tabs-content {
    width: 100%;
    padding: 0 5px;
    min-height: 325px;
  }

  .swal2-tab-panel {
    display: none;
  }

  .swal2-tab-panel.active {
    display: block;
  }

  /** 设置弹窗布局 START **/
  .__menu {
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    height: 30px !important;
    color: #666 !important;
    display: flex !important;
    font-size: 14px !important;
    line-height: 30px !important;
    font-weight: normal !important;
    align-items: center !important;
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
    justify-content: space-between !important;
    border-bottom: 1px solid #f5f5f5 !important;

    &:last-of-type {
      margin-bottom: 0 !important;
      padding-bottom: 0 !important;
      border-bottom: none !important;
    }

    input[type="text"],
    input[type="number"] {
      color: #333;
      border-radius: 3px;
      border: 1px solid #cbd5e1 !important;
      text-align: center !important;
      line-height: 12px !important;
      font-size: 12px !important;
      padding: 0 3px !important;
      height: 23px !important;
      width: 75px !important;

      &:focus {
        outline: none !important;
        border-color: #3b82f6 !important;
      }
    }

    /* 隐藏原生复选框但保留功能 */
    input[type="checkbox"] {
      position: absolute !important;
      opacity: 0 !important;
    }

    /* 开关轨道 */
    .toggle-track {
      width: 38px !important;
      height: 18px !important;
      cursor: pointer !important;
      position: relative !important;
      border-radius: 13px !important;
      background-color: #ccc !important;
      transition: background-color 0.3s ease !important;
    }

    /* 开关按钮 */
    .toggle-track::after {
      top: 3px !important;
      left: 3px !important;
      content: "" !important;
      width: 12px !important;
      height: 12px !important;
      position: absolute !important;
      border-radius: 50% !important;
      background-color: white !important;
      transition: transform 0.3s ease !important;
    }

    /* 选中状态样式 */
    input[type="checkbox"]:checked + .toggle-track {
      background-color: #2196f3 !important;
    }

    input[type="checkbox"]:checked + .toggle-track::after {
      transform: translateX(20px) !important;
    }
  }

  /** 其他设置 **/
  .others-sett {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;

    &:last-of-type {
      margin-bottom: 0 !important;
      padding-bottom: 0 !important;
      border-bottom: none !important;
    }

    p {
      margin-bottom: 3px;
      color: #333 !important;
      font-size: 13px !important;
      text-align: left !important;
    }

    textarea {
      color: #333;
      border-radius: 3px;
      width: 100% !important;
      resize: none !important;
      height: 70px !important;
      font-size: 12px !important;
      padding: 3px 5px !important;
      border: 1px solid #cbd5e1 !important;

      &::-webkit-scrollbar {
        width: 4px;
      }

      &::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
      }

      &:focus {
        outline: none !important;
        border-color: #3b82f6 !important;
      }
    }
  }
  /** 设置弹窗布局 END **/

  /** 快捷键说明弹窗布局 START **/
  table {
    width: 100% !important;
    border-collapse: collapse !important;

    th {
      font-weight: 600 !important;
    }

    th,
    td {
      line-height: 2 !important;
      font-size: 13px !important;
      vertical-align: middle !important;
      border: 1px solid #e5e6eb !important;
    }

    tr:nth-child(odd) {
      background-color: #f8f8f8 !important;
    }
  }
  /** 快捷键说明弹窗布局 END **/
}

.notyf {
  z-index: 2147483647 !important;

  .notyf__message {
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    color: #fff !important;
  }
}

/** 隐藏B站的提示 START **/
.login-tip,
.login-guide,
.live-room-app #sidebar-vm,
.lite-room .bili-mini-mask,
.live-room-app #prehold-nav-vm,
.live-room-app #shop-popover-vm,
.risk-captcha-adapt .bili-mini-mask,
#bilibili-player .bpx-player-toast-wrap,
#bilibili-player .bpx-player-cmd-dm-wrap,
#bilibili-player .bpx-player-dialog-wrap > :not(.bpx-player-dm-tip) {
  display: none !important;
}
/** 隐藏B站的提示 END **/

#buffer,
#install,
#a1 #tips,
.player-overlay,
.memory-play-wrap,
.atom-notice-click,
#loading._noplayer,
[id*="player"] #tips,
#player #loading-box,
.dplayer-comment-box,
.dplayer-notice strong,
.air-player-loading-box,
.art-layer-autoPlayback,
.art-layer-auto-playback,
.invoke-app-floating-tips,
.invoke-app-san-container {
  display: none !important;
}

/** 现代浏览器（支持 :has()）使用原生选择器 **/
@supports (selector(:has(div))) {
  #loading:not(:has([class*="player"])) {
    display: none !important;
  }
}

.Clock,
.__time-progress,
.__rate-keep-show {
  color: #e0e0e0;
  text-indent: 0 !important;
  text-shadow: 0 0 2px #000;
  position: absolute !important;
  pointer-events: none !important;
  font-family: Arial, Helvetica, sans-serif !important;
  /** 防止被隐藏 **/
  z-index: 2147483647 !important;
  opacity: 1 !important;

  /** 防止被隐藏 **/
  &::after {
    top: 50% !important;
    left: 50% !important;
    content: "-" !important;
    position: fixed !important;
    text-shadow: none !important;
    color: transparent !important;
    pointer-events: none !important;
    display: inline-block !important;
    background-color: transparent !important;
  }
}

/** 全屏时钟样式 **/
.Clock {
  top: 10px !important;
  right: 20px !important;
  width: auto !important;
  height: auto !important;
  font-size: 20px !important;
  line-height: 20px !important;
  font-weight: bold !important;
  text-align: right !important;
  background-color: transparent !important;

  &.smaller {
    font-size: 16px !important;
    line-height: 16px !important;
  }
}

/** 全屏模式下的播放进度 **/
.__time-progress {
  top: 30px !important;
  right: 20px !important;
  font-size: 12.5px !important;
  line-height: 12.5px !important;

  & b {
    font-size: 12px !important;
    line-height: 12px !important;
    display: inline-block !important;
    transform: scale(0.75) !important;
    vertical-align: middle !important;
  }

  &.smaller {
    top: 26px !important;
    transform: scale(0.817) !important;
    transform-origin: top right;
  }
}

/** 视频左上角此终显示倍速 **/
.__rate-keep-show {
  color: #c9c9c9;
  top: 5px !important;
  left: 5px !important;
  font-size: 12px !important;
  box-shadow: none !important;
  display: inline-block !important;
  transform: scale(0.917) !important;
  transform-origin: top;
}
